<?php

namespace app\index\controller;

use app\index\controller\Base;
use think\Db;

class Notice extends Base
{
    /**
     * 公告列表
     * @return mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function NoticeList(){
        $Where['id'] = array('gt',4);
        $NoticeList = Db::name('notice')->where($Where)->order('sort asc')->select();
        $this->assign('NoticeList',$NoticeList);
        return $this->fetch('NoticeList');
    }

    /**
     * 公告详情
     * @return mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function NoticeDetail(){
        $Notice = Db::name('notice')->where(['id'=>Param('id')])->find();
        $this->assign('Notice',$Notice);
        return $this->fetch('NoticeDetail');
    }
}
